<template>
  <div class="index-box mine-box scrllor">
    <div id="tixian" :class="{tixianDisabledBtn:tixianUnavailble}"  @click="showtixian">提现</div>
    <div class="user-box-title">
  <adminuserinfo></adminuserinfo>
  <div class="todayprofit">
    <p class="today-t">今日收益(元)</p>
        <p class="today-m">¥{{todaymoney}}</p>
  </div>


    </div>
    <mu-row gutter class="">
      <mu-col span="4">
        <router-link to="/admin/equip">
          <div class="grid-cell">
            <span class="iconfont icon-gateway-device"></span>
                        <p>设备管理</p>
          </div>
        </router-link>
      </mu-col>
      <mu-col span="4">
        <router-link to="/admin/order">
          <div class="grid-cell">
            <span class="iconfont icon-dingdan1"></span>
            <p>订单管理</p>
          </div>
        </router-link>
      </mu-col>
      <mu-col span="4">
        <router-link to="/admin/equipment">
          <div class="grid-cell">
            <span class="iconfont icon-jingyingguanli"></span>
            <p>经营管理</p>
          </div>
        </router-link>
      </mu-col>
      <mu-col span="4">
        <router-link to="/admin/card">
        <div class="grid-cell">
          <span class="iconfont icon-qia"></span>
          <p>电卡管理</p>
        </div>
        </router-link>
      </mu-col>
      <mu-col span="4">
        <router-link to="/admin/response">
        <div class="grid-cell">
          <span class="iconfont icon-yonghufankui"></span>
          <p>用户反馈</p>
        </div>
        </router-link>
      </mu-col>
      <mu-col span="4">
        <router-link to="/admin/mine">
        <div class="grid-cell">
          <span class="iconfont icon-me1"></span>
          <p>我的</p>
        </div>
        </router-link>
      </mu-col>
      <mu-col span="4">
        <router-link to="/admin/rules">
        <div class="grid-cell">
          <span class="iconfont icon-guizeguanli"></span>
          <p>规则管理</p>
        </div>
        </router-link>
      </mu-col>
      <mu-col span="4">
        <router-link to="/admin/users">
        <div class="grid-cell">
         <span class="iconfont icon-yonghuguanli01"></span>
          <p>用户管理</p>
        </div>
        </router-link>
      </mu-col>
    </mu-row>
       <tixian ref="tixian" @tixianUnavailable="handleTixianUnavailable"></tixian>
  </div>
</template>

<script>
import tixian from "@/components/global/tixian";
import { Toast } from "vant";
export default {
  data() {
    return {
      todaymoney: "0",
        tixianUnavailble:false
    };
  },
  components: {
    tixian: tixian
  },
  mounted(){
    this.$api.getDayProfit().then(res=>{
     this.todaymoney =  res.data.data.sumOrdergold
       console.log(res)
    })
  },
  methods:{
      handleTixianUnavailable(){
          this.tixianUnavailble=true
      },
    showtixian() {
          if(this.tixianUnavailble){
              Toast('当前可提现余额为0，无法提现')
              return false
          }
        this.$api.userInfo().then(res=>{
            if(res.data.message.status==200&&res.data.data.weixinOpenid!=null){
                this.$refs.tixian.Showtixiandiv();
            }else {
                Toast('请先绑定微信')
                this.$router.push("/admin/balance")
            }
        })
    },
  }
};
</script>

<style>
  .tixianDisabledBtn{
    background: #9ca3a5!important;
  }
</style>
